package com.example.sunmiv1.entity;

import com.contrarywind.interfaces.IPickerViewData;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018-10-17.
 */

public class ClassificationBean {

    /**
     * status : 1
     * msg : 搜索成功
     * goodscate : [{"id":"289","class_name":"SKU商品","child":[{"id":"290","class_name":"SKU商品（二級）","child":[{"id":"291","class_name":"SKU商品（三級）"}],"haschild":1,"show":false}],"haschild":1,"show":false}]
     */

    private int status;
    private String msg;
    private List<GoodscateBean> goodscate;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<GoodscateBean> getGoodscate() {
        return goodscate;
    }

    public void setGoodscate(List<GoodscateBean> goodscate) {
        this.goodscate = goodscate;
    }



    public static class GoodscateBean implements IPickerViewData {
        /**
         * id : 289
         * class_name : SKU商品
         * child : [{"id":"290","class_name":"SKU商品（二級）","child":[{"id":"291","class_name":"SKU商品（三級）"}],"haschild":1,"show":false}]
         * haschild : 1
         * show : false
         */

        private String id;
        private String class_name;
        private int haschild;
        private boolean show;
        private List<ChildBeanX> child;

        public String getId() {
            return id == null ? "" : id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getClass_name() {
            return class_name == null ? "" : class_name;
        }

        public void setClass_name(String class_name) {
            this.class_name = class_name;
        }

        public int getHaschild() {
            return haschild;
        }

        public void setHaschild(int haschild) {
            this.haschild = haschild;
        }

        public boolean isShow() {
            return show;
        }

        public void setShow(boolean show) {
            this.show = show;
        }

        public List<ChildBeanX> getChild() {
            if (child == null) {
                return new ArrayList<>();
            }
            return child;
        }

        public void setChild(List<ChildBeanX> child) {
            this.child = child;
        }

        @Override
        public String getPickerViewText() {
            return class_name;
        }

        public static class ChildBeanX implements IPickerViewData{
            /**
             * id : 290
             * class_name : SKU商品（二級）
             * child : [{"id":"291","class_name":"SKU商品（三級）"}]
             * haschild : 1
             * show : false
             */

            private String id;
            private String class_name;
            private int haschild;
            private boolean show;
            private List<ChildBean> child;

            public String getId() {
                return id == null ? "" : id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getClass_name() {
                return class_name == null ? "" : class_name;
            }

            public void setClass_name(String class_name) {
                this.class_name = class_name;
            }

            public int getHaschild() {
                return haschild;
            }

            public void setHaschild(int haschild) {
                this.haschild = haschild;
            }

            public boolean isShow() {
                return show;
            }

            public void setShow(boolean show) {
                this.show = show;
            }

            public List<ChildBean> getChild() {
                if (child == null) {
                    return new ArrayList<>();
                }
                return child;
            }

            public void setChild(List<ChildBean> child) {
                this.child = child;
            }

            @Override
            public String getPickerViewText() {
                return this.class_name;
            }

            public static class ChildBean implements IPickerViewData{
                /**
                 * id : 291
                 * class_name : SKU商品（三級）
                 */

                private String id;
                private String class_name;


                public String getId() {
                    return id == null ? "" : id;
                }

                public void setId(String id) {
                    this.id = id;
                }

                public String getClass_name() {
                    return class_name == null ? "" : class_name;
                }

                public void setClass_name(String class_name) {
                    this.class_name = class_name;
                }

                @Override
                public String getPickerViewText() {
                    return this.class_name;
                }
            }
        }
    }
}
